package com.zjpavt.client.artnet.effect;

import com.google.gson.Gson;

public class EffectFactory {
    public static IEffect getEffect(String className,String json) {
        Gson gson = new Gson();
        try {
            if (className == null) {
                return null;
            }
            Class class1 =Class.forName(className);
            IEffect effect = (IEffect) gson.fromJson(json,class1);
            return effect;
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
